Azure Deployment Slot Connection String

Posted on  by 

This repository contains GitHub Action for Azure App Service Settings to configure App settings, connection strings and other general settings in bulk using JSON syntax on your Azure WebApp (Windows or Linux) or any of its deployment slots. The action works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go and Node.js based web applications.

With the Azure App Service Actions for GitHub, you can automate your workflow to deploy Azure Web Apps and configure App settings.

Get started today with a free Azure account!

String

This repository contains GitHub Action for Azure App Service Settings to configure App settings, connection strings and other general settings in bulk using JSON syntax on your Azure WebApp (Windows or Linux) or any of its deployment slots.

The action works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go and Node.js based web applications.

If you are looking for a Github Actions to deploy code or a customized image into an Azure Webapp, consider using WebApps-deploy or webapps-container-deploy actions.

The definition of this Github Action is in action.yml.

Dependencies on other Github Actions

  • Authenticate using Azure Login

Create Azure Web App and deploy using GitHub Actions

  1. Follow the tutorial Azure Web Apps Quickstart
  2. Pick a template from https://github.com/Azure/actions-workflow-samples depending on your Azure web app runtime and place the template to .github/workflows/ in your project repository.
  3. Change app-name to your Web app name.
  4. Commit and push your project to GitHub repository, you should see a new GitHub Action initiated in Actions tab.

Configure GitHub Secrets with Azure Credentials, App Settings and Connection Strings

For using any sensitive data/secrets like Azure Service Principal, App Settings or Connection Strings within an Action, add them as secrets in the GitHub repository and then use them in the workflow.

Follow the steps to configure the secrets:

  • Define a new secret under your repository Settings > Secrets > Add a new secret menu
  • Paste the contents of the below az cli command as the value of secret variable, for example 'AZURE_CREDENTIALS'
Azure Deployment Slot Connection String
  • In the Azure portal, navigate to your app's management page. In the app's left menu, click Configuration > Application settings. To add or edit app settings in bulk, click the Advanced edit button.You could copy the existing App settings and make necessary changes or create a JSON object of the following format and define a new secret variable (APP_SETTINGS):
  • In the Azure portal, navigate to your app's management page. In the app's left menu, click Configuration > Application settings > Connection Strings. To add or edit connection strings in bulk, click the Advanced edit button.You could copy the existing App settings and make necessary changes or create a JSON object of the following format and define a new secret variable (CONNECTION_STRINGS):

Azure Web App Deployment Slot

Sample workflow to configure settings on an Azure Web App

Azure Web App Connection String

This project welcomes contributions and suggestions. Most contributions require you to agree to aContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant usthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

Azure Deployment Slots

When you submit a pull request, a CLA bot will automatically determine whether you need to providea CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructionsprovided by the bot. You will only need to do this once across all repos using our CLA.

Azure Get Connection String

This project has adopted the Microsoft Open Source Code of Conduct.For more information see the Code of Conduct FAQ orcontact opencode@microsoft.com with any additional questions or comments.

Coments are closed