How to deploy a CSES resource via ARM templates to either Staging or Prod slot based on SlotType?

Sameer Chaturvedi 0 Reputation points Microsoft Employee
2023-05-31T13:45:56.63+00:00

Hi, we are having some trouble with deploying our Cloud Service Extended Support (CSES) instance, because of the way staging and prod slots work now in CSES. Specifically, we are having difficulty with specifying the name of the CSES instance to deploy to in the ARM template for "Staging", because the current resource that is Staging depends on the SlotType in azure portal, determined by the IP to LoadBalancer mapping. This SlotType can only be utilized in an ARM template by using the "reference" template function, which is restrictive in where it can be used. I have successfully used it in the "outputs" section of a resource in a template, which I can then reference later on in the template in some properties of a resource definition, but I am not allowed to use this parameter in the "name" of the resource definition for deploying the CSES instance, because "reference" function can not be used in top level properties like 'name'. This results in us not being able to determine which CSES instance to deploy in our staging template.

I wanted to hear about how other teams are handling deploying to staging for CSES resources. Can we discuss, or can you direct me to a contact? 

Thanks for your time. 

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
677 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sameer Chaturvedi 0 Reputation points Microsoft Employee
    2023-05-31T19:10:57.3066667+00:00

    I was just able to successfully deploy. cloud-services-extended-support/VIP Swap via ARM template deployment/Swappable CSES in same resource group/CS2 at main · Azure-Samples/cloud-services-extended-support · GitHub this example was helpful. Interesting that you can use the reference() template function in the 'name' top level property of a resource definition as long as it is in a nested template... 

     

    All set now


  2. KarishmaTiwari-MSFT 18,877 Reputation points Microsoft Employee
    2023-06-01T02:37:15.7533333+00:00

    @Sameer Chaturvedi
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Accepted answers show up at the top, resulting in improved discoverability for others.

    Query: How to deploy a CSES resource via ARM templates to either Staging or Prod slot based on SlotType? We are having difficulty with specifying the name of the CSES instance to deploy to in the ARM template for "Staging".

    Solution: Cx shared - "I was just able to successfully deploy. This example was helpful: VIP Swap via ARM template deployment/Swappable CSES in same resource group/CS2
    You can use the reference () template function in the 'name' top level property of a resource definition as long as it is in a nested template."


    If your issue remains unresolved or have further questions, please let us know in the comments how we can assist.

    0 comments No comments