Need to update the above link after publishing
- Java SDK
- Maven
- Azure CLI with mesh extension
- Service Fabric CLI
- Creates a
servicefabric
folder that contains anappresources
folder which has theapplication.yaml
file.
- Creates a folder inside
servicefabric
folder with the service name and creates the service's YAML file.
- Generates a
network
YAML with the provided network name in theappresources
folder
- Generates a
gateway
YAML with the provided gateway name in theappresources
folder
- Generates a
secret
YAML with the provided secret name in theappresources
folder
- Generates a
secretvalue
YAML with the provided secret and secret value name in theappresources
folder
- Generates a
volume
YAML with the provided volume name in theappresources
folder.
- Merges the yamls from the
servicefabric
folder and creates an Azure Resource Manager template JSON in the current folder. - Deploys all the resources to the Azure Service Fabric Mesh environment
- Creates a folder (
meshDeploy
) which contains the deployment JSONs generated from yamls which are applicable for Service Fabric clusters - Deploys all the resources to the Service Fabric cluster
To use the Maven plugin in your Maven Java app, add the following snippet to your pom.xml file:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-sfmesh-maven-plugin</artifactId>
<version>0.1.0</version>
</plugin>
</plugins>
</build>
</project>
The Maven plugin currently doesn't support common configurations of Maven Plugins for Azure.
Run below command to create an application resource yaml.
mvn azure-sfmesh:init -DapplicationName=helloworldserver
- Creates a folder called
servicefabric->appresources
in your root folder that contains an application YAML namedapp_helloworldserver
Run the following command to create the network resource yaml.
mvn azure-sfmesh:addnetwork -DnetworkName=helloworldservicenetwork -DnetworkAddressPrefix=10.0.0.0/22
- Creates a network YAML in folder
servicefabric->appresources
namednetwork_helloworldservicenetwork
Run the command below to create a service yaml.
mvn azure-sfmesh:addservice -DapplicationName=helloworldserver -DserviceName=helloworldservice -DimageName=helloworldserver:latest -DlistenerPort=8080 -DnetworkRef=helloworldservicenetwork
- Creates a service YAML in folder
servicefabric->helloworldservice
namedservice_helloworldservice
that referenceshelloworldservicenetwork
& thehelloworldserver
app - The service would listen on port 8080
- The service would be using helloworldserver:latest as it's container image.
Run the command below to create a gateway resource yaml.
mvn azure-sfmesh:addgateway -DapplicationName=helloworldserver -DdestinationNetwork=helloworldservicenetwork -DgatewayName=helloworldgateway -DlistenerName=helloworldserviceListener -DserviceName=helloworldservice -DsourceNetwork=open -DtcpPort=80
- Creates a new gateway YAML in folder
servicefabric->appresources
namedgateway_helloworldgateway
- References
helloworldservicelistener
as the service listener that is listening to calls from this gateway. Also references thehelloworldservice
as the service,helloworldservicenetwork
as the network andhelloworldserver
as the application. - Listens for requests on port 80
Run the command below to create a volume resource yaml.
mvn azure-sfmesh:addvolume -DvolumeAccountKey=key -DvolumeAccountName=name -DvolumeName=vol1 -DvolumeShareName=share
- Creates a volume YAML in folder
servicefabric->appresources
namedvolume_vol1
- Sets properties for required parameters,
volumeAccountKey
, andvolumeShareName
as above - For more information on how to reference this created volume, visit the following, Deploy App using Azure Files Volume
Run the command below to create a secret resource yaml.
mvn azure-sfmesh:addsecret -DsecretName=secret1
- Creates a secret YAML in folder
servicefabric->appresources
namedsecret_secret1
- For more information on how to reference this created secret, visit the following, Manage Secrets
Run the command below to create a secretvalue resource yaml.
mvn azure-sfmesh:addsecretvalue -DsecretValue=someVal -DsecretValueName=secret1/v1
- Create a secretvalue YAML in folder
servicefabric->appresources
namedsecretvalue_secret1_v1
With the help of goal azure-sfmesh:deploytocluster
, you can run the application locally using the command below:
mvn azure-sfmesh:deploytocluster
By default this goal deploys resources to local cluster. If you are deploying to local cluster, it assumes you have a local Service Fabric cluster up and running. Local Service Fabric cluster for resources is currently supported only on Windows.
- Creates JSONs from yamls which are applicable for Service Fabric clusters
- Deploys then to the Cluster endpoint
With the help of goal azure-sfmesh:deploy
, you can deploy to Service Fabric Mesh Environment by running the command below:
mvn azure-sfmesh:deploy -DresourceGroup=todoapprg -Dlocation=eastus
- Creates a resource group called
todoapprg
if it doesn't exist. - Creates an Azure Resource Manager template JSON by merging the YAMLs.
- Deploys the JSON to the Azure Service Fabric Mesh environment.