Skip to content

Commit 65e47fc

Browse files
authored
Merge pull request #106904 from ktoliver/service-fabric-concept-resource-model
edit pass: service-fabric-concept-resource-model.md
2 parents 398ae9d + d3aa2f9 commit 65e47fc

File tree

1 file changed

+65
-55
lines changed

1 file changed

+65
-55
lines changed

articles/service-fabric/service-fabric-concept-resource-model.md

Lines changed: 65 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,100 @@
11
---
22
title: Azure Service Fabric application resource model
3-
description: This article provides an overview of managing an Azure Service Fabric application with Azure Resource Manager
3+
description: This article provides an overview of managing an Azure Service Fabric application by using Azure Resource Manager.
44
ms.topic: conceptual
55
ms.date: 10/21/2019
66
ms.custom: sfrev
77
---
88

99
# Service Fabric application resource model
1010

11-
It is recommended that Service Fabric applications are deployed onto your Service Fabric cluster via Azure Resource Manager. This method makes it possible to describe applications and services in JSON and deploy them in the same Resource Manager template as your cluster. As opposed to deploying and managing applications via PowerShell or Azure CLI, there is no need to wait for the cluster to be ready. The process of application registration, provisioning, and deployment can all happen in one step. This is the best practice to manage application life cycle in your cluster. For more information, see [Best practices: Infrastructure as code](https://docs.microsoft.com/azure/service-fabric/service-fabric-best-practices-infrastructure-as-code#azure-service-fabric-resources).
11+
You have multiple options for deploying Azure Service Fabric applications on your Service Fabric cluster. We recommend using Azure Resource Manager. If you use Resource Manager, you can describe applications and services in JSON, and then deploy them in the same Resource Manager template as your cluster. Unlike using PowerShell or Azure CLI to deploy and manage applications, if you use Resource Manager, you don't have to wait for the cluster to be ready; application registration, provisioning, and deployment can all happen in one step. Using Resource Manager is the best way to manage the application life cycle in your cluster. For more information, see [Best practices: Infrastructure as code](service-fabric-best-practices-infrastructure-as-code.md#azure-service-fabric-resources).
1212

13-
When applicable, manage your applications as Resource Manager resources to improve:
13+
Managing your applications as resources in Resource Manager can help you gain improvements in these areas:
1414

15-
* Audit trail: Resource Manager audits every operation and keeps a detailed *Activity Log* that can help you trace any changes made to these applications and your cluster.
16-
* Role-based access control: Managing access to clusters as well as applications deployed on the cluster can be done via the same Resource Manager template.
17-
* Azure Resource Manager (via the Azure portal) becomes a one-stop-shop for managing your cluster and critical application deployments.
18-
19-
## Service Fabric application life cycle with Azure Resource Manager
15+
* Audit trail: Resource Manager audits every operation and keeps a detailed activity log. An activity log can help you trace any changes made to the applications and to your cluster.
16+
* Role-based access control: You can manage access to clusters and to applications deployed on the cluster by using the same Resource Manager template.
17+
* Management efficiency: Using Resource Manager gives you a single location (the Azure portal) for managing your cluster and critical application deployments.
2018

2119
In this document, you will learn how to:
2220

2321
> [!div class="checklist"]
2422
>
25-
> * Deploy application resources using Azure Resource Manager
26-
> * Upgrade application resources using Azure Resource Manager
27-
> * Delete application resources
23+
> * Deploy application resources by using Resource Manager.
24+
> * Upgrade application resources by using Resource Manager.
25+
> * Delete application resources.
26+
27+
## Deploy application resources
28+
29+
The high-level steps you take to deploy an application and its services by using the Resource Manager application resource model are:
30+
1. Package the application code.
31+
1. Upload the package.
32+
1. Reference the location of the package in a Resource Manager template as an application resource.
2833

29-
## Deploy application resources using Azure Resource Manager
34+
For more information, view [Package an application](service-fabric-package-apps.md#create-an-sfpkg).
3035

31-
To deploy an application and its services using the Azure Resource Manager application resource model, you need to package application code, upload the package, and then reference the location of package in an Azure Resource Manager template as an application resource. For more information, view [Package an application](https://docs.microsoft.com/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg).
36+
Then, you create a Resource Manager template, update the parameters file with application details, and deploy the template on the Service Fabric cluster. [Explore samples](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/tree/master/ARM).
3237

33-
Then, create an Azure Resource Manager template, update the parameters file with application details, and deploy it on the Service Fabric cluster. Refer to samples [here](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/tree/master/ARM).
38+
### Create a storage account
3439

35-
### Create a Storage account
40+
To deploy an application from a Resource Manager template, you must have a storage account. The storage account is used to stage the application image.
3641

37-
Deploying an application from a Resource Manager template requires a storage account to stage the application image. You can re-use an existing storage account or create a new storage account to stage your applications. If you would like to use an existing storage account, you can skip this step.
42+
You can reuse an existing storage account or you can create a new storage account for staging your applications. If you use an existing storage account, you can skip this step.
3843

3944
![Create a storage account][CreateStorageAccount]
4045

41-
### Configure Storage account
46+
### Configure your storage account
4247

43-
Once the storage account has been created, you need to create a blob container where the applications can be staged. In the Azure portal, navigate to the storage account that you would like to store your applications. Select the **Blobs** blade, and click the **Add Container** button. Resources in your cluster can be secured by setting the public access level to private. Access can be granted in a number of ways:
48+
After the storage account is created, you create a blob container where the applications can be staged. In the Azure portal, go to the Azure Storage account where you want to store your applications. Select **Blobs** > **Add Container**.
4449

45-
* [Authorize access to blobs and queues with Azure Active Directory](../storage/common/storage-auth-aad-app.md)
46-
* [Grant access to Azure blob and queue data with RBAC in the Azure portal](../storage/common/storage-auth-aad-rbac-portal.md)
47-
* [Delegate access with a shared access signature (SAS)](https://docs.microsoft.com/rest/api/storageservices/delegate-access-with-shared-access-signature
48-
)
50+
Resources in your cluster can be secured by setting the public access level to **private**. You can grant access in multiple ways:
4951

50-
For this example we will proceed using anonymous read access for blobs.
52+
* Authorize access to blobs and queues by using [Azure Active Directory](../storage/common/storage-auth-aad-app.md).
53+
* Grant access to Azure blob and queue data by using [RBAC in the Azure portal](../storage/common/storage-auth-aad-rbac-portal.md).
54+
* Delegate access by using a [shared access signature](https://docs.microsoft.com/rest/api/storageservices/delegate-access-with-shared-access-signature).
55+
56+
The example in the following screenshot uses anonymous read access for blobs.
5157

5258
![Create blob][CreateBlob]
5359

54-
### Stage application in a Storage account
60+
### Stage the application in your storage account
61+
62+
Before you can deploy an application, you must stage the application in blob storage. In this tutorial, we create the application package manually. Keep in mind that this step can be automated. For more information, see [Package an application](service-fabric-package-apps.md#create-an-sfpkg).
5563

56-
Before the application can be deployed, it must be staged in blob storage. In this tutorial we will create the application package manually, however this step can be automated. For more information, view [Package an application](https://docs.microsoft.com/azure/service-fabric/service-fabric-package-apps#create-an-sfpkg). In the following steps the [Voting sample application](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart) will be used.
64+
In this tutorial, we use the [Voting sample application](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart).
5765

58-
1. In Visual Studio right-click on the Voting project and select package.
59-
![Package Application][PackageApplication]
60-
2. Open the **.\service-fabric-dotnet-quickstart\Voting\pkg\Debug** directory that was just create, and zip the contents into a file called **Voting.zip** such that the ApplicationManifest.xml is at the root of the zip file.
61-
![Zip Application][ZipApplication]
62-
3. Rename the extension of the file from .zip to **.sfpkg**.
63-
4. In the Azure portal, in the **apps** container of your storage account, click **Upload** and upload **Voting.sfpkg**.
64-
![Upload App Package][UploadAppPkg]
66+
1. In Visual Studio, right-click the **Voting** project, and then select **Package**.
6567

66-
The application is now staged. We are now ready to create the Azure Resource Manager template to deploy the application.
68+
![Package Application][PackageApplication]
69+
1. Go to the *.\service-fabric-dotnet-quickstart\Voting\pkg\Debug* directory. Zip the contents into a file called *Voting.zip*. The *ApplicationManifest.xml* file should be at the root in the zip file.
6770

68-
### Create the Azure Resource Manager template
71+
![Zip Application][ZipApplication]
72+
1. Rename the file to change the extension from .zip to *.sfpkg*.
6973

70-
The sample application contains [Azure Resource Manager Templates](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/tree/master/ARM) that can be used to deploy the application. The template files are named **UserApp.json** and **UserApp.Parameters.json**.
74+
1. In the Azure portal, in the **apps** container for your storage account, select **Upload**, and then upload **Voting.sfpkg**.
75+
76+
![Upload App Package][UploadAppPkg]
77+
78+
Now, the application is now staged and you can create the Resource Manager template to deploy the application.
79+
80+
### Create the Resource Manager template
81+
82+
The sample application contains [Azure Resource Manager templates](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/tree/master/ARM) you can use to deploy the application. The template file names are *UserApp.json* and *UserApp.Parameters.json*.
7183

7284
> [!NOTE]
73-
> The **UserApp.Parameters.json** file must be updated with the name of your cluster.
85+
> The *UserApp.Parameters.json* file must be updated with the name of your cluster.
7486
>
7587
>
7688
7789
| Parameter | Description | Example | Comments |
7890
| ---------------------- | ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
7991
| clusterName | The name of the cluster you're deploying to | sf-cluster123 | |
8092
| application | The name of the application | Voting |
81-
| applicationTypeName | The type name of the application | VotingType | Must match what's in ApplicationManifest.xml |
82-
| applicationTypeVersion | The version of the application type | 1.0.0 | Must match what's in ApplicationManifest.xml |
83-
| serviceName | The name of the service the service | Voting~VotingWeb | Must be in the format ApplicationName~ServiceType |
84-
| serviceTypeName | The type name of the service | VotingWeb | Must match what's in the ServiceManifest.xml |
85-
| appPackageUrl | The blob storage URL of the application | https://servicefabricapps.blob.core.windows.net/apps/Voting.sfpkg | The URL of the application package in blob storage (the procedure to set this is described below) |
93+
| applicationTypeName | The type name of the application | VotingType | Must match ApplicationManifest.xml |
94+
| applicationTypeVersion | The version of the application type | 1.0.0 | Must match ApplicationManifest.xml |
95+
| serviceName | The name of the service | Voting~VotingWeb | Must be in the format ApplicationName~ServiceType |
96+
| serviceTypeName | The type name of the service | VotingWeb | Must match ServiceManifest.xml |
97+
| appPackageUrl | The blob storage URL of the application | https://servicefabricapps.blob.core.windows.net/apps/Voting.sfpkg | The URL of the application package in blob storage (the procedure to set the URL is described later in the article) |
8698

8799
```json
88100
{
@@ -113,17 +125,17 @@ The sample application contains [Azure Resource Manager Templates](https://githu
113125

114126
### Deploy the application
115127

116-
To deploy the application, run the New-AzResourceGroupDeployment to deploy to the resource group which contains your cluster.
128+
Run the **New-AzResourceGroupDeployment** cmdlet to deploy the application to the resource group that contains your cluster:
117129

118130
```powershell
119131
New-AzResourceGroupDeployment -ResourceGroupName "sf-cluster-rg" -TemplateParameterFile ".\UserApp.Parameters.json" -TemplateFile ".\UserApp.json" -Verbose
120132
```
121133

122-
## Upgrade Service Fabric application using Azure Resource Manager
134+
## Upgrade the Service Fabric application by using Resource Manager
123135

124-
Applications already deployed to a Service Fabric cluster will be upgraded for the following reasons:
136+
You might upgrade an application that's already deployed to a Service Fabric cluster for one of these reasons:
125137

126-
1. A new service is added to the application. A service definition must be added to service-manifest.xml and application-manifest.xml file. Then to reflect new version of application, you need to update the application type version from 1.0.0 to 1.0.1 [UserApp.parameters.json](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/blob/master/ARM/UserApp.Parameters.json).
138+
* A new service is added to the application. A service definition must be added to *service-manifest.xml* and *application-manifest.xml* files when a service is added to the application. To reflect a new version of an application, you also must change the application type version from 1.0.0 to 1.0.1 in [UserApp.Parameters.json](https://github.com/Azure-Samples/service-fabric-dotnet-quickstart/blob/master/ARM/UserApp.Parameters.json):
127139

128140
```json
129141
"applicationTypeVersion": {
@@ -137,7 +149,7 @@ Applications already deployed to a Service Fabric cluster will be upgraded for t
137149
}
138150
```
139151

140-
2. A new version of an existing service is added to the application. This involves application code changes and updates to app type version and name.
152+
* A new version of an existing service is added to the application. Examples include application code changes and updates to app type version and name. For this upgrade, update UserApp.Parameters.json like this:
141153

142154
```json
143155
"applicationTypeVersion": {
@@ -147,15 +159,15 @@ Applications already deployed to a Service Fabric cluster will be upgraded for t
147159

148160
## Delete application resources
149161

150-
Applications deployed using the application resource model in Azure Resource Manager can be deleted from cluster using below steps
162+
To delete an application that was deployed by using the application resource model in Resource Manager:
151163

152-
1) Get resource ID for application using [Get-AzResource](https://docs.microsoft.com/powershell/module/az.resources/get-azresource?view=azps-2.5.0):
164+
1. Use the [Get-AzResource](https://docs.microsoft.com/powershell/module/az.resources/get-azresource?view=azps-2.5.0) cmdlet to get the resource ID for the application:
153165

154166
```powershell
155167
Get-AzResource -Name <String> | f1
156168
```
157169

158-
2) Delete the application resources using [Remove-AzResource](https://docs.microsoft.com/powershell/module/az.resources/remove-azresource?view=azps-2.5.0):
170+
1. Use the [Remove-AzResource](https://docs.microsoft.com/powershell/module/az.resources/remove-azresource?view=azps-2.5.0) cmdlet to delete the application resources:
159171

160172
```powershell
161173
Remove-AzResource -ResourceId <String> [-Force] [-ApiVersion <String>]
@@ -165,13 +177,11 @@ Applications deployed using the application resource model in Azure Resource Man
165177

166178
Get information about the application resource model:
167179

168-
* [Model an application in Service Fabric](https://docs.microsoft.com/azure/service-fabric/service-fabric-application-model)
169-
* [Service Fabric application and service manifests](https://docs.microsoft.com/azure/service-fabric/service-fabric-application-and-service-manifests)
170-
171-
## See Also
180+
* [Model an application in Service Fabric](service-fabric-application-model.md)
181+
* [Service Fabric application and service manifests](service-fabric-application-and-service-manifests.md)
182+
* [Best practices: Infrastructure as code](service-fabric-best-practices-infrastructure-as-code.md#azure-service-fabric-resources)
183+
* [Manage applications and services as Azure resources](service-fabric-best-practices-infrastructure-as-code.md)
172184

173-
* [Best practices](https://docs.microsoft.com/azure/service-fabric/service-fabric-best-practices-infrastructure-as-code)
174-
* [Manage applications and services as Azure Resources](https://docs.microsoft.com/azure/service-fabric/service-fabric-best-practices-infrastructure-as-code)
175185

176186
<!--Image references-->
177187
[CreateStorageAccount]: ./media/service-fabric-application-model/create-storage-account.png

0 commit comments

Comments
 (0)