> For the complete documentation index, see [llms.txt](https://maqsoftware.gitbook.io/loadfast-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maqsoftware.gitbook.io/loadfast-technical-documentation/setting-up/configure/execute-the-powershell-script-in-windows-powershell-ise.md).

# Execute the PowerShell Script in Windows PowerShell ISE

## Set up PowerShell

To run the PowerShell script, you must have Owner access on the Azure subscription

1. Download the [PowerShell script file](https://links.maqsoftware.com/3EdETrg) and extract the contents to a folder on your local system. You can run the script either on **Windows** or via **Azure Cloud Shell**.

   **Running the Script on Windows:**

   1. Press the **Windows key**, search for **Windows PowerShell ISE**, and **Run as Adminstrator**.

      <figure><img src="/files/0ZDl0vZmPig6mSKeJaXr" alt=""><figcaption></figcaption></figure>
   2. Click on **File** > **Open...** from the top menu to open the script file.

      <figure><img src="/files/sY7vLNaBqDQkuFEChQ2l" alt=""><figcaption></figcaption></figure>
   3. Navigate to the extracted folder and select the script inside the **LoadFAST Windows PowerShell Script** folder.

      <figure><img src="/files/22JssmrsVwznE2HdimKh" alt=""><figcaption></figcaption></figure>
   4. Press **F5 key** or click the green **Play** button in the toolbar to execute the script.

      <figure><img src="/files/ZbaaiOuZzX4xKS9G707t" alt=""><figcaption></figcaption></figure>
   5. The script will begin execution and prompt you for input. Provide the required information as requested.

      <figure><img src="/files/0vNz9Zmm81EOnnqlkZD0" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The Windows PowerShell ISE must be opened in the same location as the downloaded PowerShell zip.
{% endhint %}

**For running script in Azure cloud shell**

1. Open [Azure portal](https://portal.azure.com) and launch **Azure cloud shell**.

   <figure><img src="/files/OEZRHsRWj3pQK2wiVuZr" alt=""><figcaption></figcaption></figure>
2. Click **Switch to PowerShell**.

   <figure><img src="/files/PyV2Xf3yVhNo8IYeTH4f" alt=""><figcaption></figcaption></figure>
3. Click **Manage files** to upload your script.

   <figure><img src="/files/hHwgkYR84fPwrk0Qv52k" alt=""><figcaption></figcaption></figure>
4. Upload both files from **LoadFAST Azure PowerShell Script** inside the extracted folder.

   <figure><img src="/files/cV4vqcD1aTEGJzne3p8E" alt=""><figcaption></figcaption></figure>
5. Run the script using **& './Azure Cloud PowerShell Script.ps1'** command.
6. The script will prompt you for required input. Fill in the information as needed.

   <figure><img src="/files/0vNz9Zmm81EOnnqlkZD0" alt=""><figcaption></figcaption></figure>

   If you see an error message after entering inputs

   <figure><img src="/files/C4c0OHrKmsZZ7lNArUoG" alt=""><figcaption></figcaption></figure>

   Click on **New session** and re-run the script.

   <figure><img src="/files/CcISuHf6g3QsiOu6yGzA" alt=""><figcaption></figcaption></figure>
7. You’ll be prompted to log in. Copy the code shown and click the provided link.

   <figure><img src="/files/m2cVpk0iORdR3VOajDnv" alt=""><figcaption></figcaption></figure>
8. Paste the code into the login screen and sign in with your account.

   <figure><img src="/files/c4EQQWEXybofwrZwoRtu" alt=""><figcaption></figcaption></figure>
9. After logging in, enter your **client secret** when prompted. The script will now run successfully.

   <figure><img src="/files/PM22zbV1zMFu6zBcgQ5j" alt=""><figcaption></figcaption></figure>

## Provide inputs for the prompts

### **Enter your tenant ID**

Follow the steps below to find your tenant ID:

1. Type “**App registrations**" in the [Azure portal](https://portal.azure.com) search bar and select said option as it appears.

   <figure><img src="/files/ipyPI9yv9wvVuOmfFggw" alt=""><figcaption></figcaption></figure>
2. Find and select the application registration [previously created](https://maqsoftware.gitbook.io/pbi-load-analyzer-technical-documentation/setting-up/pre-deployment/create-an-app-registration-for-the-loadfast-api#create-an-app-registration) for the LoadFAST API on the list.

   <figure><img src="/files/UaLkrhWrTYKR31stl609" alt=""><figcaption></figcaption></figure>
3. This takes you to its summary page where you can find the directory (tenant) ID and copy it directly to your clipboard.

   <figure><img src="/files/7Hhpozjy0uu0eYML2dAU" alt=""><figcaption></figcaption></figure>
4. In the PowerShell terminal, paste/enter the subscription ID from the previous step.

### **Enter your subscription ID**

Follow the steps below to find your subscription ID:

1. Type “**Resource groups**" in the [Azure portal](https://portal.azure.com) search bar and select said option as it appears.

   <figure><img src="/files/rp4F19BEIQHUDY2aDSJZ" alt=""><figcaption></figcaption></figure>
2. Once on the page, you will see a list of resource groups displayed. Select the resource group where you want to deploy the tool resources to. This can be resource group

   <figure><img src="/files/pxJNCagZD94JmufnsSaq" alt=""><figcaption></figcaption></figure>
3. Copy the subscription ID as shown below.

   <figure><img src="/files/0DFlboCdcIdXM9UWUa0o" alt=""><figcaption></figcaption></figure>
4. In the PowerShell terminal, paste/enter the subscription ID from the previous step.

### **Enter your resource group name**

1. Type “Resource groups" in the Azure portal search bar and select said option as it appears.

   <figure><img src="/files/rp4F19BEIQHUDY2aDSJZ" alt=""><figcaption></figcaption></figure>
2. Once on the page, you will see a list of resource groups displayed. Select the resource group that you have used [earlier](/loadfast-technical-documentation/setting-up/deploy/deploy-automatically-via-azure-marketplace.md#create-a-managed-application) to create the managed application.

   <figure><img src="/files/pxJNCagZD94JmufnsSaq" alt=""><figcaption></figcaption></figure>
3. Find and select the managed application as shown in the image below:\\

   <figure><img src="/files/F5qIomocmiQyjHXAjNWQ" alt=""><figcaption></figcaption></figure>
4. Copy the name of the managed resource group.

<figure><img src="/files/IBBXg63dszRCh02LAakW" alt=""><figcaption></figcaption></figure>

5. Paste/enter the managed resource group name in the PowerShell terminal like the previous steps.

### **Log into Azure through the PowerShell pop-up window**

If already logged into Azure, it will ask you to pick an account. If not, then you need to sign in with your Azure account.

<figure><img src="/files/alCDVVDLniqmi6JlN5Ya" alt=""><figcaption></figcaption></figure>

## Other details

* See the output and any actions performed by the script in the console pane at the bottom of the PowerShell window.

  <figure><img src="/files/OE2JFBgDOQdIg03GnOl2" alt=""><figcaption></figcaption></figure>
* To verify the backend deployment, follow these steps:
  1. Type “**Kubernetes services**" in the Azure portal search bar and select said option as it appears.

     <figure><img src="/files/CPtCazi8AHbsK3g5da4D" alt=""><figcaption></figcaption></figure>
  2. Once on the page, you will see a list of Kubernetes clusters displayed. Select the Kubernetes cluster created for your web app (more information regarding cluster name detailed in the note).

{% hint style="info" %}
**Note:** Kubernetes clusters are automatically created and named as follows: "**WebAppName**\_AksCluster".

In our case, our web app was named "**powerbiloadanalyzer**" (as seen in step 4 of this [process](https://maqsoftware.gitbook.io/pbi-load-analyzer-technical-documentation/setting-up/deployment/deploy-automatically-via-azure-marketplace#create-a-managed-application)). Thus, our Kuberenetes cluster name is "powerbiloadanalyzer\_AksCluster".
{% endhint %}

<figure><img src="/files/PU7r3XcQdbBHYs69bSu1" alt=""><figcaption></figcaption></figure>

3. Select **Workloads** (under Kubernetes resources) from the left pane.

<figure><img src="/files/TSgDT0dpGNKWf9xO1R0e" alt=""><figcaption></figcaption></figure>

4. Under the **Deployments** tab, you can see all the deployments. Ensure that they all have a green tick in the **Ready** column.

<figure><img src="/files/mvNt3VarPTMQn6kApq0M" alt=""><figcaption></figcaption></figure>
