-
Notifications
You must be signed in to change notification settings - Fork 811
Run as an Azure Web App Using GitHub Action
Bryan Soltis edited this page Mar 19, 2024
·
14 revisions
This process will allow you to deploy the Azure Naming Tool as a .NET 8 application as an Azure Web App. This is the fastest deployment option and allows you to deploy and utilize your installation in minutes. The provided GitHub Action will deploy your repository code on every commit. This installation process provides the most secure, scalable solution for your installation.
At a high level, this is the installation process:
-
Fork the Azure Naming Tool Repository
-
Create an Azure Web App
The App Service can be created manually, or leverage the Deploy to Azure options below.
-
Enable Azure Web App Authentication
Require users to authenticate to Azure AD to access the App Service.
-
Create GitHub secrets
These secrets are used by the GitHub Action to build the application in the Azure App Service.
-
Enable GitHub Action
Enable automative deployment of the tool when GitHub repository is updated.
- Scroll up to the top-left corner of this page.
- Click on the AzureNamingTool link to open the root of this repository.
- Click the Fork option in the top-right menu.
- Select your desired Owner and Repository name and click Create fork.
- Click the green <>Code button
- Click the .github/workflows link.
- Click the .deploy-azure-naming-tool-to-azure-webapps-dotnet-core.yml link.
- Review the instructions for creating the required GitHub secrets.
NOTES:
- The GitHub Action will not successfully deploy until the secrets are created.
- You must create an Azure Web App and configure the GitHub Action secrets to deploy to your Azure Web App.
- Create a new Azure Web App in the Azure portal.
- For the Publish option, select Code.
- For the Runtime stack, select .NET 8.
- Download the Publish Profile for use within the GitHub Action secret.
Get-AzWebApp -Name <webappname> | Get-AzWebAppPublishingProfile -OutputFile <filename> | Out-Null
** OR **
- In the Azure Portal for your Azure Web App, Navigate to the Authentication blade.
- Select Add identity provider.
- In the Identity provider section, select Microsoft.
- Enter the desired Name. All other options can be left as default.
- Click Add.
- In your GitHub repository, click Settings in the top menu.
- Click Secrets in the left menu.
- Click New repository secret.
- Enter AZURE_WEBAPP_PUBLISH_PROFILE as the Name.
- Enter the Publish Profile data for your Azure Web App as the Value.
- Click Add secret.
- Click New repository secret.
- Enter AZURE_WEBAPP_NAME as the Name.
- Enter the name of your Azure Web App as the Value.
- In your GitHub repository, click the Actions tab.
- Click on I understand my workflows, go ahead and enable them.
- Select the Azure Naming Tool - Build and deploy to an Azure Web App workflow in the left navigation.
- Click Run workflow.
- Confirm the workflow completes successfully.
- Access your Azure Web App to confirm the site is successfully deployed.
NOTE:
If your website does not load, check the configuration to ensure the dotnet AzureNamingTool.dll command is set on startup.