As you think about building applications in Azure, or migrating VMs to Azure, one of the common first thoughts you might have is âHow do my monitoring activities change once Iâve moved to Azure?â. I get this question (or a variation thereof) quite often when meeting with my customers, so I thought it would be a good idea to dig a bit deeper and provide some details around what tools are available to you.
Monitoring encompasses several different, but related topics. Have you ever had any of the following questions about your infrastructure?
As youâll see, Azure provides tools to answer all of these questions, and depending on what you are deploying in Azure, you can also bring many of your own tools. Letâs take a look at whatâs available. Note: this post is rather long, but in this case, thatâs a good thing!
In the following post, Iâll introduce and provide links for the following monitoring tools:
Azure Monitor
Perhaps the best place to start is with the tool Azure Monitor. This tool can be thought of as a PaaS monitoring tool that is available to use against all services in Azure using the Azure management portal. The graphic below depicts the sources of monitoring data on the left in the purple boxes, and what can be done with this data on the right in the blue boxes. There are different levels of monitoring depending on weather you are monitoring IaaS or PaaS services. Note that data collected can be routed to other Azure services, stored in Azure blob storage, queried, visualized, or be used to kick off some type of automation using webhooks.
Activity Logs
A fundamental collection source is activity logs, which are logs specific to Azure platform level objects, which come from the control plane. For example, an activity log will capture activities to answers questions such as âWho stopped that virtual machine?â, âIs there an outage in US West?â, or âWhen did my App Service scale up and scale down automatically?â. The activity log will contain a significant number of log entries over time and is therefore searchable based on subscription, resource group, resource type, operation type, and timespan (among others). Activity logs are turned on and retain data for 90 days by default. Learn more about activity logs here.
Diagnostics Logs
In addition to activity logs, Azure Monitor provides us with diagnostic logs. Diagnostic logs operate at both a resource-level and guest OS-level. Resource-level diagnostics capture resource specific data from the Azure platform (PaaS), while OS-level diagnostics capture data from the VM, operating system, and applications running within (IaaS). Think of resource-level diagnostics as logs that help you understand what operations occurred within a resource at the platform level. The available options differ based on the resource you have chosen. For example, with a recovery services vault, you can choose to get diagnostics logs for Backup reports, Site Recovery Jobs, or Site Recovery Events, to name a few. With OS-level diagnostics you can be very specific on what you choose to capture per VM. For example, you can choose basic performance counters, or get more specific by perusing the countless counters available in the custom settings. You can also choose which logs you want to capture weather it be application logs, IIS logs, event tracing logs, etc.âyou get to choose how much you want to capture. You can also capture crash dumps or send data to application insights (discussed below).
Select your images in the File Explorer, using Ctrl or Shift to select multiple images. For frame of reference, hereâs what our current desktop looks like, with the default Windows 10 wallpaper repeated on each of our three monitors.Itâs nice wallpaper, as far as stock wallpaper goes, but a tad boring. Letâs mix it up. Windows 10 red wallpaper. The Easy, but Imperfect Method: Change Your Wallpaper With the Windows File ExplorerThe first method isnât intuitive, because it relies on you selecting the images in Windowsâ File Explorer and knowing how Windows will handle your multiple image selection. For each method, weâll use a handful of Game of Thrones wallpapers to demonstrate.
Diagnostics logs are not turned on by default, you will choose per PaaS object or IaaS VM what you want to monitor. Of course, you can always use templates or scripts to define these settings for all future deployments. Learn more about diagnostics logs here. Keep in mind that with VMs, you can also continue monitoring the guest level events using tools that youâve used on-premises.
Metrics
Metrics are provided by Azure Monitor to get telemetry and visibility into the performance and health of your workloads on Azure. These metrics are available for nearly all Azure resources including both PaaS and IaaS offerings. Metrics are on by default at the resource-level, which includes virtual machines. For virtual machines, this means host level telemetry is available by default. If you want to dig deeper into the metrics of the operating system and applications, then turning on diagnostics for a VM will expose these metrics to Azure Monitor for building dashboards, getting alerts, and taking action on these metrics. In the graphic below, I have used Azure Monitor Metrics to define a metrics chart for a webapp, which I later pinned to my dashboard. Read more about Metrics here.
Alerts
You can use Azure Monitor Alerts to take trigger-based actions on events that occur in activity logs or through metrics. For example, if I want to be alerted when a VMâs CPU sustains greater than 90% usage (Guest metrics) for 15 minutes, I can easily configure an alert. On the other hand, if I want to know if a VM is turned on (activity log), I can also be alerted to this activity. There are numerous scenarios that youâll want to investigate. Once an alert is triggered, I can send emails, txt messages, trigger webhooks, or even run Azure Automation runbooks. Learn more about alerts here.
Azure Network Watcher
Azure Network Watcher provides many capabilities that will benefit you as you deploy and manage your Azure infrastructure. As you can see in the graphic below, Network Watcher is another tool, just like Azure Monitor, which is provided without you having to deploy anything, you simply have to enable it. Think of this tool as a network monitoring technology provided as a service.
Network Watcher provides several important capabilities including:
As you deploy networking components and VMs in Azure, you can have a mental idea of how everything is connected, and you can spend time building out a Visio diagram, but there is a better way. Network Watcher allows you to choose a VNet from any of your subscriptions to have the tool build out a diagram of the topology. The image below shows a diagram (rendered by Network Watcher) of an ADFS infrastructure deployed as part of my ADFS Deployment Series from a while back. Note the details included for NICs, NSGs, Subnets, load balancers, etc. The tool also lets you download a copy for your own documentation and internal sharing needs.
Various layers of security across VNETs, subnets, and network interface cards can make it very challenging to determine if the packets sent from a source and destination are allowed. IP Flow Verify simplifies this process by allowing you to test the flow of traffic between two sources using the protocol, the source and destination IP, and the source and destination port. If the connection is blocked, youâll be able to see the NSG that has the rules that block it.
Next hop allows you to choose a virtual machine, a network interface from that virtual machine, and finally a source and destination address. With these items chosen, click the âNext Hopâ button to see which route will be chosen for the destination IP address. This can be helpful if you are defining custom routes and need to make sure the routing is working as you expected.
This tool is very helpful to understand the âeffectiveâ results of various Network Security Groups that impact a particular VM. With the tool you simply choose a VM, and let the tool output the effective rules as seen in the graphic below. You can then find the scope of where a particular rule is set by clicking on the tabs for subnet, NIC, and default. Note: If you have started using Security Center Just-in-time security rules, this is an interesting place to see how those are applied (rules 1000 and 1001 below were automated from Security Center JIT)
Have a VPN or ExpressRoute connection that you would like to troubleshoot? Network Watcher provides us with the capability of troubleshooting both the gateway and connections that may be experiencing issues. You will be able to see error messages and capture log data for review.
This powerful feature allows you to capture packets as they enter or leave a virtual machine. This is useful for analysis, intrusion detection, performance monitoring, and more. You can selectively capture packets that meet certain criteria for a limited amount of time. You could also use alerts from Azure monitor to programmatically enable a packet capture scenario. Captured data can be placed in blob storage and downloaded as a standard .cap file.
At the time of this post, Connectivity Check is still in preview, however it is something you can use if you have preview features turned on in your subscription. The essence of this tool is to give you the ability to actually test connectivity between two VMs in Azure, or a VM in Azure and some FQDN, URI, or IPv4 address. The results returned will include a connection status of âreachableâ or âunreachableâ.
Network Subscription Limits
This tool lets you check in and see how much of each network resource you are using and the related limits in your subscription. This can be very useful for understanding your networking footprint and what changes you may need to make as you grow your Azure footprint. Simply choose your subscription and region, and let the tool calculate the results.
Ever wonder what traffic is flowing through a network security group? NSG flows is a logging tool that lets you turn on flow logging per NSG, choose a retention period, and then capture 5-tuple information, in JSON format, about what traffic is passing through. The output will show both allowed and denied logs, which can be helpful for troubleshooting connectivity issues, particularly if you arenât certain of the requirements of such connections.
Application Insights
To this point, weâve focused on monitoring Azure control plane events through Activity logs, and Guest OS level events through Azure Diagnostics. How about application level events? Application Insights is a 'monitoring as a service' solution, but specifically for Azure App Service applications. This includes WebApps, Mobile Apps, Logic Apps, etc. With Application Insights you can see page views and unique visitors, as well as failures, latency statistics, and a whole lot more. You can use the same tools as mentioned for Monitor above to export this data for alerting, viewing in PowerBI, building dashboards, triggering events, etc. In the graphic below you can see that Iâve pinned Application Insights to my favorites on the management portal. To the right of that, youâll see the App Service applications where Iâve enabled Application Insights, and on the far right, all the tools available to me to get deep insights into my applications. Youâll want to make sure that any developers in your organization are aware of these toolsets, as this will provide significant insight into application performance and bottlenecks, while also providing useful dashboards that can output ongoing telemetry. You can learn more about Application Insights at the documentation site, but I would also advise watching the 2 minute video below to get a quick example of how it can be used.
Log Analytics
Most organizations have a number of tools they use to monitor their environment, some for on-premises, some for cloud, and then additional tools for niche solutions. With Azure Log Analytics, you can collect and correlate data from multiple sources to get a unified dashboard view and gain insights to detect and mitigate IT issues.
Think of Azure Monitor as a way to collect and analyze data for your Azure resources, but think of Log Analytics as the tool you can use to correlate that data with data coming from other sources such as an on-premises SCOM environment, or even VMs running in other cloud platforms. In the graphic below you can see that Log Analytics can ingest data from Azure VMs (associate Azure VMs with Log Analytics with just a few clicks), from SCOM agents you already have deployed, and from VMs or physical servers where you install the agents available for download from the Log Analytics portal. All of this data ends up in a central repository that you can manually search with a rich query language. See the query language documentation to see just how powerful these interactive queries can be.
The capabilities donât end there. Log Analytics also provides canned solutions that are configured to look for specific things such as AD Replication Health events, SQL Health, AD Health, and the list goes on. See a clipping from the solutions gallery below. Using these solutions will give you immediate insight into the data you are collecting from all sources.
I would recommend checking out the Azure Friday video on Azure Log Analytics, and then heading over to the official documentation to learn more.
Security Center
As organizations move their workloads to the public cloud, security becomes one of the most important areas of interest and concern. Microsoft takes security very seriously, and Azure Security Center is one example of what has resulted.
Azure Security Center is a platform that helps organizations do two important tasks. First, we want to prevent attacks on our platforms by deploying secure and resilient architectures. Second, if we happen to experience some type of attack or intrusion, we want to detect it and respond appropriately. Azure Security Center gives you a set of tools to prevent and detect attacks, all centrally managed in the Azure Portal that is familiar to you. Learn how Azure Security Center detects and responds to threats on your behalf.
The graphic below shows the landing page of Security Center, which provides an overview of current recommendations and events, displays tiles that depict specific information to help you prevent attacks, and details information that helps you understand security alerts and attacked resources, so you can appropriately respond. This tool also provides the ability to provide Just-In-Time (JIT) access to VMs in the cloud by automatically updating network security groups to allow connections and then closing those connections automatically after a specified period of time. In addition, you can create application white lists to allow the tool to prevent any application not on the list from being executed in your VMs. To get started with Azure Security Center and learn how you can use the tool to protect, detect, and alert you to events, see the landing page.
Important Update! - Azure Security Center can now monitor your on-premises and 3rd party cloud applications!
Azure Log Integration
The Azure Log Integration service is a tool you can download and install onto a Windows Server 2008 R2 or later server, which enables you to gather raw logs from Azure resources and share those logs with third party SIEM systems. You can choose to install on a server running in your own datacenter or in Azure. Please check out the overview of the tool and detailed installation instructions to learn more.
Once installed, the tool collects Windows events, Azure AD Audit logs, Azure activity logs, Azure Security Center alerts, and Azure Diagnostics logs from Azure. The graphic below depicts how the integration works with third party SIEM systems including Splunk, HP Arcsight, and IBM QRader. You can read about partner integration here.
Track tasks and feature requests
Join 36 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.
Sign up for free See pricing for teams and enterprises
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking âSign up for GitHubâ, you agree to our terms of service and privacy statement. Weâll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commentscommented Jan 27, 2016
commented Jan 29, 2016
commented Jan 29, 2016
commented Feb 2, 2016
commented May 21, 2016
commented May 28, 2016
commented May 31, 2016
commented Jun 1, 2016
commented Jun 1, 2016
commented Jun 28, 2016
commented Sep 1, 2016â¢
edited
commented Sep 23, 2016
commented Sep 23, 2016â¢
edited
commented Oct 6, 2016
commented Oct 6, 2016
commented Feb 10, 2017
commented Jul 7, 2017
commented Jul 7, 2017
commented Jul 9, 2018
referenced this issue Jul 23, 2018OpenGet-AzureRMVM -Status yields different result when running against a single machine rather than a pool of machines #3896commented Jan 19, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Managing role definitions ^
Almost every day we keep hearing of new developments and features coming in Azure. With this, it is getting more important to maintain services in an isolated and secure manner. Azure has a very wide range of services that several different teams at companies consume. At a company, it is critical to separate roles and permissions and assign correct permissions to correct teams so that each team can only access the resources they are responsible for.
Each role in Azure consists of a number of role actions that are like permission sets. You can customize these permission sets if you need to create any custom roles. In such cases, you can pick up required actions and place them in a custom role definition that you can then assign to a specific user, group, or application.
First, let's take a look at all available roles in Azure. Roles in Azure are called 'role definitions.' You can list them with this command:
1(Get-AzureRmRoleDefinition'Network Contributor').actions
The actions in a role definition are permission sets used to grant access to objects
As seen above, the Network Contributor role has seven actions defined in it. Let's look at another example for the Virtual Machine Contributor role and see what actions it contains.
1(Get-AzureRmRoleDefinition'Virtual Machine Contributor').actionsVirtual Machine Contributor role actions
The Virtual Machine Contributor role has a number of actions available. You may have noticed that both the Network Contributor and Virtual Machine Contributor roles have some common actions defined in their action lists. That's because virtual machine administrators may need to manage network-related resources such as network interface cards, load balancers, and so on, which might be associated with a certain virtual machine.
Managing role assignments ^
It is also important for admins to check who has access on resources such as a subscription or a resource group. To view current permissions on all resources to which a user has access, use the following line:
1
In case we'd like to list the permissions of a group a specific user is a member of on all resources, we need to use the following:
1Get-AzureRmRoleAssignment-SignInName'[email protected]'-ExpandPrincipalGroupsA user's permissions on a resource inherited from a group
ObjectType simply shows whether the object is a user, group, or application.
If we want to list permissions on a specific resource, we can narrow down the result by specifying the scope using this command:
1Get-AzureRmRoleAssignment-scope'/subscriptions/f0675ec9-480d-4c2a-982a-ed97983af390'|select displaynameAll objects that have permissions over a specific subscription
This command lists all objects including users, groups, and applications that have permissions on a specific resource. In this scenario it is a subscription.
Managing custom roles ^
Besides listing roles and permissions in Azure, it is also very important for admins to be able to grant users or groups the necessary roles on certain resources. To be able to assign a role to a group, first we need to get the group's ObjectID using the command below:
1Get-AzureRmADGroup-SearchString'Sales (Sample Group)'Getting a group's ObjectID
We can now assign a role to this group using the ObjectID of the group, the role definition required, and the scope. In this scenario we will assign the Virtual Machine Contributor role to the Sales group over the subscription with a subscription ID of f0675ec9-480d-4c2a-982a-ed97983af390.
Get All Resource Groups In A Subscription Powershell1New-AzureRmRoleAssignment-ObjectId'74b007ea-ab34-4209-981e-c538200fe251'âRoleDefinitionName'Virtual Machine Contributor'-Scope'/subscriptions/f0675ec9-480d-4c2a-982a-ed97983af390'Creating a custom role and assigning it to a group
Of course, we can grant users and applications specific permissions in exactly the same way we used above.
To remove a role from a specific user, group, or application:
1Remove-AzureRmRoleAssignment-ObjectId'74b007ea-ab34-4209-981e-c538200fe251'-RoleDefinitionName'Virtual Machine Contributor'-Scope'/subscriptions/f0675ec9-480d-4c2a-982a-ed97983af390'Removing a custom role
As you can see, there are hundreds of different scenarios when it comes to managing roles and permissions in Azure.
Creating a role-based access control report ^
Lastly, let's create a report in detail showing all the permissions assigned to users, groups, and applications throughout a subscription.
123456789101112$result=@()$result+='displayname,objecttype,roledefinitionname,actions'Get-AzureRmRoleAssignment-scope'/subscriptions/f0675ec9-480d-4c2a-982a-ed97983af390'|foreach{$displayname=$_.DisplayName$objecttype=$_.ObjectType$roledefinitionname=$_.RoleDefinitionName$actions=(Get-AzureRmRoleDefinition-Name$_
In this article, we've had a look at Azure roles and how we can easily manage role assignment tasks for Azure resources.
Join the 4sysops PowerShell group!
3+
Related PostsUse Windows Admin Center with PowerShell
Restore Group Policy with PowerShell
I have C# code running on an Azure Windows VM. Is there a way for me to find out what Resource Group this VM is in?
VM has been deployed with Azure Resource Management API (new, not classic)
Igorek
IgorekIgorek
13.5k11 gold badge3636 silver badges8080 bronze badges
3 Answers
The following will guarantee the ability to distinguish between vm's with the same name across different resource groups:
From your C# code, find the vmId (involves running one of the commands at the following link or possibly using an Azure SDK: https://azure.microsoft.com/en-us/blog/accessing-and-using-azure-vm-unique-id/). If using a Linux VM, be sure to take into account the different endian-ness, otherwise the vmId will not match.
Once you have the vmId, you can use either CLI or Powershell (or potentially an Azure SDK) to list all of the VM's in the subscription, then search through the list to find which VM has the vmId you got from the machine. Then you should be able to parse out the resource group name from the 'id' field of the json for that VM (which, as Gaurav mentioned, is a string with the resource group in it). For an example, try the following:
This command will show you the url's it is using to make the requests and the response body. In this body you will find the 'vmId' and 'id' field. For instance, one of the requests it sends is:
and the response body for this is the json with the relevant entries. Hope this helps! :)
Neil Sant GatNeil Sant Gat
One way to find out the resource group is to list all the virtual machines in your Azure Subscription. The URL you would use for that would be:
It will return you a list of all Virtual Machines in your Azure Subscription in JSON format where each item represents a Virtual Machine. You can first filter by the
name property to find the matching Virtual Machine. Then the property which is important to you there is id which is always of the format:
/subscriptions/[subscription-id]/resourceGroups/[resource-group-name]/providers/Microsoft.Compute/virtualMachines/[virtual-machine-name]
You could simply parse this to get the resource group name.
Gaurav MantriGaurav Mantri
76.7k88 gold badges120120 silver badges144144 bronze badges
How did you deploy the VM? Through portal.azure.com? Through CLI? Powershell? In any of these cases, usually you are required to specify a resource group name. In fact, in the portal, if you click on 'Virtual Machines', it should say the resource group:
Neil Sant GatNeil Sant Gat
Not the answer you're looking for? Browse other questions tagged azureazure-virtual-machineazure-resource-manager or ask your own question.Getting Started with the Portal SDK
The Azure Portal SDK includes everything you need to build extensions for the portal. Included are variety of tools and samples that help developers build extensions on top of the framework. There are three common experiences for Azure resources; Create, Browse, and Resource Management. This guide will walk you through creating your first extension, running that extension and then running the unit tests for that extension.
Installing the Azure Portal SDK
Creating and running an Extension
Note: If you are not seeing the allow Untrusted Extensions dialog there are two common issues in the FAQ.
Congratulations! You've just created your first extension.You will find that the project template has implemented many of the key components of an extension.
Exploring the ExtensionMarketplace Create Experience
The marketplace offers users a consistent way to browse and search the set of curated items that they can purchase/create. If you plan on selling resources in the portal then you will need to integrate into the marketplace by building and publishing a package to the marketplace service. Contact [email protected] to onboard. This section will walk you through the basics of the marketplace.
In the browser that has the portal and your side loaded extension, go to the marketplace by:
Then click the
Local Development category. A marketplace item will appear that matches the name you selected when creating your project.
Click the gallery item
AzurePortalExtension1 to launch the gallery items details blade.
The code to define the gallery package which provided the above experience is located in the GalleryPackages directory of the Extension project. It includes all the categorization, text, and images that you've seen so far.
When you click the
Create button the portal will open the blade that is defined in GalleryPackages/Create/UIDefinition.json.
When you clicked
Create the following CreateBlade from the project template is shown. This is a basic implementation of create that asks the user to specify the common Azure Resource properties.
The code that implements the create blade above is located in Client/Resource/Create/ViewModels. Note that the class name 'CreateBlade' in the CreateBlade.ts matches the name in the UIDefinition.json file.
Fill out the create form and click New to actually create a resource.For more information on creating gallery packages and create forms see the gallery documentation.Now that you have created a resource it is time to explore how users will find that resource via the browse experience.
Browse
The portal exposes a common navigation experience, called 'Browse', that gives end users a list of all the different services and resource types offered by the portal.
You probably want your assets to be exposed in the navigation system. This section provides an overview.
In the running portal you can navigate to
All Resources . In the blade that opens set the types filter to My Resources . The browse experience will then show all resources of that type. You should see the resource you created earlier.
The code for the browse implementation is located in Client/Browse. You can replace the Microsoft.PortalSdk/rootResourcesresource type name with your production Resource Provider (RP) type and your resources will show in the list on your next F5.
When you click on
someresourcename it will launch the Resource Menu blade as defined in the BladeName property of the asset type. In the image below you can see for this extension it is the ResourceOverviewBlade
For more information on the browse experience see the browse documentation.
Now that you know that the
ResourceOverviewBlade will be opened when you click on the resource you created in Browse its now time to explore Resource Menu blades.
Resource Menu Blade
If you are building an extension for an Azure service then it's likely you have built a resource provider that exposes a top-level resource (e.g. Virtual Machine, Storage account).
If that's the case then the resource menu blade is a great starting point. The idea is that after the user selects a particular resource from the browse experience they land on a menu blade that has a mixture of standard resource features (e.g. activity log, role based access control, Support, etc) and service-specific features (e.g. Tables in a storage account). This section walks through the basics.
Click on your resource from within the browse list it will open the resource menu blade as we previously learned in
Browse.pdl from AzurePortalExtension1 this action will open ResourceOverviewBlade .
Many of the standard Azure experiences such as tags, locks, and access control have been automatically injected into your menu.
In
Client/Resources/MyResourcesViewModel.ts you can see how the items of the resource menu are customized and added to the resource menu. For example see the Overview item from the menu is created by creating a MenuItem and the action performed when clicking it is defined via the supplyBladeReference. In this case it is opening the ResourceOverviewBlade.
The ResourceOverviewBlade that is opened via the supply blade reference is the rendered portion highlighted in red below.
The code for this Template Blade is implemented in
/Resource/Blades/Overview/ResourceOverviewBlade.ts
As an exercise review the ResourceOverviewBlade.ts source and try to map the components in the UI to their implementation.
Adding a Blade
Blades are the main unit of UX that can be built using the SDK. They are basically pages that can be loaded in the portal.
Now that your blade successfully compiles lets provide a means for users to navigate to it in the portal. Recall the Resource Overview Blade had a Resource Menu. Lets update the resource menu to open the HelloWorldBlade when
Item1 in the menu is clicked.
Note: that if HellowWorldBladeReference is not available on BladeReferences then you need to ensure the solution has compiled correctly as the blade references are generated as part of build.
Now that you have finished adding your blade and have provided a means to navigate to it lets try it out.
To learn more about:
Running Unit Tests
You may have noticed that there is a Unit Test project within the generated solution you have been working with. The unit test framework, msportalfx-ut, provides a set APIs to make it simple to instantiate a blades view model, transition the blade lifecycle and assert state of the view model at different stages of that lifecycle.
If you open
/test/ResourceOverviewBlade.test.ts you can see a simple test against the ResourceOverviewBlade.
In step 1 within the above image the test uses sinonjs to setup a mock response for a request to the Resource Provider the ResourceOveviewBlade will call.
In step 2 within the above image the msportalfx-ut TemplateBladeHarness API is used to initialize a ResourceOverviewBlade with the arguments supplied in step 3. The callbacks provided in step three also provide a useful place to perform assertions against the view model at different stages in the blade lifecycle namely
beforeOnInitializeCalled , afterOnInitializeCalled , afterRevealContentCalled . Once the promise returned by the TemplateBladeHarness.initializeBlade function resolves you are then able to assert the state of the blades view model as it stands after the blades onInitializeMethod has resolved. In this case you can see the first assert statement is validating that the blades title is equal to 'bar' i.e the same value that was setup in the sinonjs mock in step 1.
To run the tests:
Test run output:
To learn more about the unit test framework, namely msportalfx-ut, see the unit test documentation.
Questions?
Ask questions on: stackoverflow.microsoft.com, for a set of tags supported by the Azure Portal team see supported tags
FAQ:I receive a 'this site is not secure' or 'your connection is not private' error when running the extension
Example in Edge:
Example in chrome Chrome:Your connection is not privateAttackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). Learn moreNET::ERR_CERT_AUTHORITY_INVALID
Solution:
The portal is never loaded so the extension has not sideloaded
This is generally a popup blocker. After running F5 if you only have one tab open to
https://localhost:44300 as opposed to two tabs then it is likely that your popup blocker is stopping the first tab from launching the second tab that loads the portal and sideloads your extension. To solve this simply enable https://localhost:44300 in your browsers popup blocker.
I'm stuck. Where can I find help?
SOLUTION: There are a few ways to get help.
If you are unable to find an answer, reach out to the Ibiza team at Stackoverflow Ibiza. For a list of topics and stackoverflow tags, see supported tags.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |