Skip to content

Commit 9e81812

Browse files
authored
Merge pull request #178423 from stevevi/steveviAzureGov7
remove Feedback from Next steps
2 parents c52808d + 6c2b8a8 commit 9e81812

File tree

3 files changed

+188
-199
lines changed

3 files changed

+188
-199
lines changed

articles/azure-government/connect-with-azure-pipelines.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
---
2-
title: Deploy an app in Azure Government with Azure Pipelines | Microsoft Docs
2+
title: Deploy an app in Azure Government with Azure Pipelines
33
description: Information on configuring continuous deployment to your applications hosted with a subscription in Azure Government by connecting from Azure Pipelines.
4-
services: azure-government
5-
cloud: gov
6-
documentationcenter: ''
7-
84
ms.service: azure-government
9-
ms.devlang: na
105
ms.topic: article
11-
ms.tgt_pltfrm: na
12-
ms.workload: azure-government
13-
ms.date: 10/25/2018
146
ms.custom: devx-track-azurepowershell
7+
ms.date: 11/02/2021
158
---
169

1710
# Deploy an app in Azure Government with Azure Pipelines
1811

1912
This article helps you use Azure Pipelines to set up continuous integration (CI) and continuous deployment (CD) of your web app running in Azure Government. CI/CD automates the build of your code from a repo along with the deployment (release) of the built code artifacts to a service or set of services in Azure Government. In this tutorial, you will build a web app and deploy it to an Azure Governments app service. This build and release process is triggered by a change to a code file in the repo.
2013

2114
> [!NOTE]
22-
> Azure Pipelines is not available as part of Azure Government. While this tutorial shows how to configure the CI/CD capabilities of Azure Pipelines in order to deploy an app to a service inside Azure Government, be aware that Azure Pipelines runs its pipelines outside of Azure Government. Research your organization's security and service policies before using it as part of your deployment tools.
15+
> For special considerations when deploying apps to Azure Government, see **[Deploy apps to Azure Government Cloud](/azure/devops/pipelines/library/government-cloud).**
2316
2417
[Azure Pipelines](/azure/devops/pipelines/get-started/) is used by teams to configure continuous deployment for applications hosted in Azure subscriptions. We can use this service for applications running in Azure Government by defining [service connections](/azure/devops/pipelines/library/service-endpoints) for Azure Government.
2518

@@ -31,7 +24,7 @@ Before starting this tutorial, you must have the following:
3124

3225
+ [Create an organization in Azure DevOps](/azure/devops/organizations/accounts/create-organization)
3326
+ [Create and add a project to the Azure DevOps organization](/azure/devops/organizations/projects/create-project?;bc=%2fazure%2fdevops%2fuser-guide%2fbreadcrumb%2ftoc.json&tabs=new-nav&toc=%2fazure%2fdevops%2fuser-guide%2ftoc.json)
34-
+ Install and set up [Azure Powershell](/powershell/azure/install-az-ps)
27+
+ Install and set up [Azure PowerShell](/powershell/azure/install-az-ps)
3528

3629
If you don't have an active Azure Government subscription, create a [free account](https://azure.microsoft.com/overview/clouds/government/) before you begin.
3730

@@ -50,12 +43,12 @@ Follow through one of the quickstarts below to set up a Build for your specific
5043

5144
## Generate a service principal
5245

53-
1. Download or copy and paste the [service principal creation](https://github.com/yujhongmicrosoft/spncreationn/blob/master/spncreation.ps1) powershell script into an IDE or editor.
46+
1. Download or copy and paste the [service principal creation](https://github.com/yujhongmicrosoft/spncreationn/blob/master/spncreation.ps1) PowerShell script into an IDE or editor.
5447

5548
2. Open up the file and navigate to the `param` parameter. Replace the `$environmentName` variable with
5649
AzureUSGovernment." This sets the service principal to be created in Azure Government.
5750

58-
3. Open your Powershell window and run the following command. This command sets a policy that enables running local files.
51+
3. Open your PowerShell window and run the following command. This command sets a policy that enables running local files.
5952

6053
`Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`
6154

@@ -92,13 +85,13 @@ Follow [Deploy a web app to Azure App Services](/azure/devops/pipelines/apps/cd/
9285

9386
## Q&A
9487

95-
Q: Do I need a build agent?<br/>
96-
A: You need at least one [agent](/azure/devops/pipelines/agents/agents) to run your deployments. By default, the build and deployment processes are configured to use the [hosted agents](/azure/devops/pipelines/agents/agents#microsoft-hosted-agents). Configuring a private agent would limit data sharing outside of Azure Government.
88+
**Do I need a build agent?** <br/>
89+
You need at least one [agent](/azure/devops/pipelines/agents/agents) to run your deployments. By default, the build and deployment processes are configured to use the [hosted agents](/azure/devops/pipelines/agents/agents#microsoft-hosted-agents). Configuring a private agent would limit data sharing outside of Azure Government.
9790

98-
Q: I use Team Foundation Server on-premises. Can I configure CD on my server to target Azure Government?<br/>
99-
A: Currently, Team Foundation Server cannot be used to deploy to an Azure Government Cloud.
91+
**I use Team Foundation Server on-premises. Can I configure CD on my server to target Azure Government?** <br/>
92+
Currently, Team Foundation Server cannot be used to deploy to an Azure Government Cloud.
10093

10194
## Next steps
102-
* Subscribe to the [Azure Government blog](https://blogs.msdn.microsoft.com/azuregov/)
103-
* Get help on Stack Overflow by using the "[azure-gov](https://stackoverflow.com/questions/tagged/azure-gov)" tag
104-
* Give us feedback or request new features via the [Azure Government feedback forum](https://feedback.azure.com/d365community/)
95+
96+
- Subscribe to the [Azure Government blog](https://blogs.msdn.microsoft.com/azuregov/)
97+
- Get help on Stack Overflow by using the "[azure-gov](https://stackoverflow.com/questions/tagged/azure-gov)" tag
Lines changed: 108 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,108 @@
1-
---
2-
title: Azure Government Integrate Azure AD Authentication | Microsoft Docs
3-
description: This article demonstrates how to integrating Azure AD Authentication on Azure Government.
4-
services: azure-government
5-
cloud: gov
6-
documentationcenter: ''
7-
8-
ms.service: azure-government
9-
ms.devlang: na
10-
ms.topic: article
11-
ms.tgt_pltfrm: na
12-
ms.workload: azure-government
13-
ms.date: 11/2/2017
14-
15-
---
16-
# Integrate Azure AD Authentication with Web Apps on Azure Government
17-
The following quickstart helps you get started integrating Azure AD Authentication with applications on Azure Government. Azure Active Directory (Azure AD) Authentication on Azure Government is similar to the Azure commercial platform, with a [few exceptions](./compare-azure-government-global-azure.md).
18-
19-
Learn more about [Azure Active Directory Authentication Scenarios](../active-directory/develop/authentication-vs-authorization.md).
20-
21-
## Integrate Azure AD login into a web application using OpenID Connect
22-
This section shows how to integrate Azure AD using the OpenID Connect protocol for signing in users into a web app.
23-
24-
### Prerequisites
25-
- An Azure AD tenant in Azure Government. You must have an [Azure Government subscription](https://azure.microsoft.com/overview/clouds/government/request/) in order to have an Azure AD tenant in Azure Government. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](../active-directory/develop/quickstart-create-new-tenant.md)
26-
- A user account in your Azure AD tenant. This sample does not work with a Microsoft account, so if you signed in to the Azure Government portal with a Microsoft account and have never created a user account in your directory before, you need to do that now.
27-
- Have an [ASP.NET Core application deployed and running in Azure Government](documentation-government-howto-deploy-webandmobile.md)
28-
29-
### Step 1: Register your web application with your Azure AD Tenant
30-
31-
1. Sign in to the [Azure Government portal](https://portal.azure.us).
32-
2. On the top bar, click on your account and under the **Directory** list, choose the Active Directory tenant where you wish to register your application.
33-
3. Click on **All Services** in the left-hand nav, and choose **Azure Active Directory**.
34-
4. Click on **App registrations** and choose **Add**.
35-
5. Enter the name for your application, and select 'Web Application and/or Web API' as the Application Type. For the sign-on URL, enter the base URL for your application, which is your Azure App URL + "/signin-oidc."
36-
37-
>[!Note]
38-
> If you have not deployed your application and want to run it locally, your App URL would be your local host address.
39-
>
40-
>
41-
42-
Click on **Create** to create the application.
43-
6. While still in the Azure portal, choose your application, click on **Settings**, and choose **Properties**.
44-
7. Find the Application ID value and copy it to the clipboard.
45-
8. For the App ID URI, enter https://\<your_tenant_name\>/\<name_of_your_app\>, replacing \<your_tenant_name\> with the name of your Azure AD tenant and \<name_of_your_app\> with the name of your application.
46-
47-
### Step 2: Configure your app to use your Azure AD tenant
48-
#### Azure Government Variations
49-
The only variation when setting up Azure AD Authorization on the Azure Government cloud is in the Azure AD Instance:
50-
- "https:\//login.microsoftonline.us"
51-
52-
#### Configure the InventoryApp project
53-
1. Open your application in Visual Studio 2019.
54-
2. Open the `appsettings.json` file.
55-
3. Add an `Authentication` section and fill out the properties with your Azure AD tenant information.
56-
57-
```cs
58-
//ClientId: Azure AD-> App registrations -> Application ID
59-
//Domain: <tenantname>.onmicrosoft.com
60-
//TenantId: Azure AD -> Properties -> Directory ID
61-
62-
"Authentication": {
63-
"AzureAd": {
64-
65-
"Azure ADInstance": "https://login.microsoftonline.us/",
66-
"CallbackPath": "/signin-oidc",
67-
"ClientId": "<clientid>",
68-
"Domain": "<domainname>",
69-
"TenantId": "<tenantid>"
70-
}
71-
}
72-
```
73-
4. Fill out the `ClientId` property with the Client ID for your app from the Azure Government portal. You can find the Client ID by navigating to Azure AD -> App Registrations -> Your Application -> Application ID.
74-
5. Fill out the `TenantId` property with the Tenant ID for your app from the Azure Government portal. You can find the Tenant ID by navigating to Azure AD -> Properties -> Directory ID.
75-
6. Fill out the `Domain` property with `<tenantname>.onmicrosoft.com`.
76-
7. Open the `startup.cs` file.
77-
8. In your `ConfigureServices` method, add the following code:
78-
79-
```cs
80-
public void ConfigureServices(IServiceCollection services)
81-
{
82-
//Add Azure AD authentication
83-
services.AddAuthentication(options => {
84-
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
85-
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
86-
})
87-
.AddCookie()
88-
.AddOpenIdConnect(options => {
89-
options.Authority = Configuration["Authentication:AzureAd:Azure ADInstance"] + Configuration["Authentication:AzureAd:TenantId"];
90-
options.ClientId = Configuration["Authentication:AzureAd:ClientId"];
91-
options.CallbackPath = Configuration["Authentication:AzureAd:CallbackPath"];
92-
});
93-
94-
}
95-
```
96-
97-
In the same file, add this one line of code to the `Configure` method:
98-
99-
```csharp
100-
app.UseAuthentication();
101-
```
102-
103-
9. Navigate to your **Home** controller or whichever controller file is your home page, **where you want your users to log in**. Add the `[Authorize]` tag before the class definition.
104-
105-
## Next steps
106-
107-
* Navigate to the [Azure Government PaaS Sample](https://github.com/Azure-Samples/gov-paas-sample) to see Azure AD Authentication as well as other services being integrated in an Application running on Azure Government.
108-
* Subscribe to the [Azure Government blog](https://blogs.msdn.microsoft.com/azuregov/)
109-
* Get help on Stack Overflow by using the "[azure-gov](https://stackoverflow.com/questions/tagged/azure-gov)" tag
110-
* Give feedback or request new features via the [Azure Government feedback forum](https://feedback.azure.com/d365community/)
1+
---
2+
title: Azure Government integrate Azure AD Authentication
3+
description: This article demonstrates how to integrating Azure AD authentication on Azure Government.
4+
ms.service: azure-government
5+
ms.topic: article
6+
ms.date: 11/02/2021
7+
---
8+
9+
# Integrate Azure AD authentication with Web Apps on Azure Government
10+
11+
The following quickstart helps you get started integrating Azure AD Authentication with applications on Azure Government. Azure Active Directory (Azure AD) Authentication on Azure Government is similar to the Azure commercial platform, with a [few exceptions](./compare-azure-government-global-azure.md).
12+
13+
Learn more about [Azure Active Directory Authentication Scenarios](../active-directory/develop/authentication-vs-authorization.md).
14+
15+
## Integrate Azure AD login into a web application using OpenID Connect
16+
17+
This section shows how to integrate Azure AD using the OpenID Connect protocol for signing in users into a web app.
18+
19+
### Prerequisites
20+
21+
- An Azure AD tenant in Azure Government. You must have an [Azure Government subscription](https://azure.microsoft.com/overview/clouds/government/request/) in order to have an Azure AD tenant in Azure Government. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](../active-directory/develop/quickstart-create-new-tenant.md)
22+
- A user account in your Azure AD tenant. This sample does not work with a Microsoft account, so if you signed in to the Azure Government portal with a Microsoft account and have never created a user account in your directory before, you need to do that now.
23+
- Have an [ASP.NET Core application deployed and running in Azure Government](documentation-government-howto-deploy-webandmobile.md)
24+
25+
### Step 1: Register your web application with your Azure AD Tenant
26+
27+
1. Sign in to the [Azure Government portal](https://portal.azure.us).
28+
2. On the top bar, click on your account and under the **Directory** list, choose the Active Directory tenant where you wish to register your application.
29+
3. Click on **All Services** in the left-hand nav, and choose **Azure Active Directory**.
30+
4. Click on **App registrations** and choose **Add**.
31+
5. Enter the name for your application, and select 'Web Application and/or Web API' as the Application Type. For the sign-on URL, enter the base URL for your application, which is your Azure App URL + "/signin-oidc."
32+
33+
>[!Note]
34+
> If you have not deployed your application and want to run it locally, your App URL would be your local host address.
35+
>
36+
>
37+
38+
Click on **Create** to create the application.
39+
6. While still in the Azure portal, choose your application, click on **Settings**, and choose **Properties**.
40+
7. Find the Application ID value and copy it to the clipboard.
41+
8. For the App ID URI, enter https://\<your_tenant_name\>/\<name_of_your_app\>, replacing \<your_tenant_name\> with the name of your Azure AD tenant and \<name_of_your_app\> with the name of your application.
42+
43+
### Step 2: Configure your app to use your Azure AD tenant
44+
45+
#### Azure Government Variations
46+
47+
The only variation when setting up Azure AD Authorization on the Azure Government cloud is in the Azure AD Instance:
48+
- "https:\//login.microsoftonline.us"
49+
50+
#### Configure the InventoryApp project
51+
52+
1. Open your application in Visual Studio 2019.
53+
2. Open the `appsettings.json` file.
54+
3. Add an `Authentication` section and fill out the properties with your Azure AD tenant information.
55+
56+
```cs
57+
//ClientId: Azure AD-> App registrations -> Application ID
58+
//Domain: <tenantname>.onmicrosoft.com
59+
//TenantId: Azure AD -> Properties -> Directory ID
60+
61+
"Authentication": {
62+
"AzureAd": {
63+
64+
"Azure ADInstance": "https://login.microsoftonline.us/",
65+
"CallbackPath": "/signin-oidc",
66+
"ClientId": "<clientid>",
67+
"Domain": "<domainname>",
68+
"TenantId": "<tenantid>"
69+
}
70+
}
71+
```
72+
4. Fill out the `ClientId` property with the Client ID for your app from the Azure Government portal. You can find the Client ID by navigating to Azure AD -> App Registrations -> Your Application -> Application ID.
73+
5. Fill out the `TenantId` property with the Tenant ID for your app from the Azure Government portal. You can find the Tenant ID by navigating to Azure AD -> Properties -> Directory ID.
74+
6. Fill out the `Domain` property with `<tenantname>.onmicrosoft.com`.
75+
7. Open the `startup.cs` file.
76+
8. In your `ConfigureServices` method, add the following code:
77+
78+
```cs
79+
public void ConfigureServices(IServiceCollection services)
80+
{
81+
//Add Azure AD authentication
82+
services.AddAuthentication(options => {
83+
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
84+
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
85+
})
86+
.AddCookie()
87+
.AddOpenIdConnect(options => {
88+
options.Authority = Configuration["Authentication:AzureAd:Azure ADInstance"] + Configuration["Authentication:AzureAd:TenantId"];
89+
options.ClientId = Configuration["Authentication:AzureAd:ClientId"];
90+
options.CallbackPath = Configuration["Authentication:AzureAd:CallbackPath"];
91+
});
92+
93+
}
94+
```
95+
96+
In the same file, add this one line of code to the `Configure` method:
97+
98+
```csharp
99+
app.UseAuthentication();
100+
```
101+
102+
9. Navigate to your **Home** controller or whichever controller file is your home page, **where you want your users to log in**. Add the `[Authorize]` tag before the class definition.
103+
104+
## Next steps
105+
106+
* Navigate to the [Azure Government PaaS Sample](https://github.com/Azure-Samples/gov-paas-sample) to see Azure AD Authentication as well as other services being integrated in an Application running on Azure Government.
107+
* Subscribe to the [Azure Government blog](https://blogs.msdn.microsoft.com/azuregov/)
108+
* Get help on Stack Overflow by using the "[azure-gov](https://stackoverflow.com/questions/tagged/azure-gov)" tag

0 commit comments

Comments
 (0)