azure-vm-templates 相关问题


是否可以将 IP 地址从 Azure 分配/关联到外部设备 [已关闭]

在 Azure 中创建 VM 时,您需要将 VM 关联到 IP 地址。是否可以为外部设备保留 IP 地址?例如,我购买了外部硬盘(我不会


MDE.Windows Azure VM 扩展配置失败

我们最近将 Windows Server 2016 从 Onprem 迁移到 Azure 云。之后我注意到“MDE.Windows”扩展显示“配置失败”消息。下面是...


在 Azure 中添加 Linux Defender 扩展时出现问题

注意:交叉发布在 Hashicorp 论坛:https://discuss.hashicorp.com/t/problems-in-adding-linux-defender-extension-in-azure/53949 我正在尝试将 MS Defender 扩展添加到 Linux VM (rockylin...


如何让 Azure Graph Explorer 返回 subscriptionId 的 GUID 值,而不是将其转换为名称?

我正在导出 Azure 资源列表(假设是 VM)及其相应的 SubscriptionId(GUID)。 尝试通过 Graph Explorer 执行此操作似乎正在翻译并且


Linux VM 上的服务器重新启动 - 警报规则

我希望在 Azure Monitor 中创建警报规则来检测 Linux VM 上的服务器重新启动。我有一个用于在 Windows 虚拟机上重新启动服务器的方法,但我找不到如何在 Linux 上检测这一点。 我试过烤...


Azure 应用程序网关在进行 JMeter 负载测试时随机遇到 504 网关超时

我有 1 个应用程序网关,它有 2 个后端(Azure VM),它通过 IIS 托管 ASP CORE REST API。两者都使用端口 80 进行通信。 手动测试一切正常...


OpenJDK 与 Java HotspotVM

OpenJDK VM 和 Oracle Hotspot VM 仍然是两个不同的 JVM 吗? 我似乎找不到任何有关 OpenJDK VM 的官方文档。甚至在 OpenJDK 主页上也有一个 HotSpot G...


Hotspot VM 是如何生成 String oops 和mirror oops 的?

在openjdk8源代码中,我发现一些java.lang.String oop不经过字节码引擎并由jvm本身分配。正如 hotspot/src/share/vm/classfile/javaClasses.cpp:185 所说: 手柄


如何将“block”元素分组到“<p class="p">”元素中?

我想将 元素分组到 元素内部。如果 follow-sibling[1] 是 元素并且 我想将 <block> 元素分组到 <p class="p"> 元素内部。如果 <p class="p"> follow-sibling[1] 是 <block> 元素且 <p class="p1"> 值位于 <p class="p"> 元素中。 输入XML文件-: <root> <p class="p">aaaaaa</p> <block> <p>block</p> </block> <p class="p1"> bbb </p> <block> <p>block</p> </block> <p class="p1">bbb.</p> <p class="p">cccc</p> </root> 我想要下面的预期输出。 输出XML文件: <root> <p class="p">aaaaaa<block><p>block</p></block> bbb <block><p>block</p></block>bbb.</p> <p class="p">cccc</p> </root> 我们能否以另一种方式将逻辑纠正到输出上方,我在输出上方使用 XSLT: <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="p[@class='p']"> <xsl:choose> <xsl:when test="following-sibling::*[1][self::block]"> <xsl:text disable-output-escaping="yes">&lt;p&gt;</xsl:text> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <p><xsl:apply-templates select="@*|node()"/></p> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="p[@class='p1']"> <xsl:choose> <xsl:when test="following-sibling::*[1][self::p[@class='p']]"> <xsl:apply-templates/> <xsl:text disable-output-escaping="yes">&lt;/p&gt;</xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:template> 以下内容似乎包装/分组了输入示例的正确节点,但我不确定它是否实现了您的要求,我还不太理解它们。 <xsl:template match="root"> <xsl:copy> <xsl:for-each-group select="*" group-starting-with="p[@class = 'p']"> <xsl:copy> <xsl:apply-templates select="node(), current-group() except ."/> </xsl:copy> </xsl:for-each-group> </xsl:copy> </xsl:template>


如何将 '<p class="p1">' 、 '<div class="disp-quote-p">/following-sibling::*[1][self::p[@class='p1']]' 包装/分组在单个 'p' 元素中

我正在包装节点 ' 、 '' 和 div[@class='disp-quote-p']/following-sibling::*[1][self::p[@class=' p1']] 里面... 我正在尝试将节点 <p class="p1">' , '<div class="disp-quote-p">' and div[@class='disp-quote-p']/following-sibling::*[1][self::p[@class='p1']] 包裹在单个 p 元素中。 输入 XML:- <root> <p class="p">aa</p> <p class="p1">Although:</p> <div class="disp-quote-p"> <p class="p">We had seen.</p> </div> <p class="p1">This dot.</p> <img src="a.png"/> <box>box</box> <p class="p">bb</p> </root> 我正在尝试将节点包装在单个 p 元素中的代码,但此节点 <p class="p1">This dot.</p> 与 <div class="disp-quote-p"> 节点一起包装。 <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="root"> <xsl:copy> <xsl:for-each-group select="*" group-starting-with="p[@class='p1']"> <xsl:for-each-group select="current-group()" group-adjacent="self::p[@class='p1'] or self::div[@class='disp-quote-p']"> <xsl:choose> <xsl:when test="self::p[@class='p1']"> <p><xsl:apply-templates select="node(), current-group() except ."/></p> </xsl:when> <xsl:otherwise> <xsl:copy-of select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:for-each-group> </xsl:copy> </xsl:template> 网址链接:[http://xsltransform.net/eiov64R/1] 预期输出:- <root> <p class="p">aa</p> <p>Although:<disp-quote><p class="p">We had seen.</p></disp-quote>This dot.</p> <img src="a.png"/> <box>box</box> <p class="p">bb</p> </root> 试试这个: <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="root"> <xsl:copy> <xsl:for-each-group select="*" group-adjacent="if(self::p[@class='p1'] or self::div) then -1 else position()"> <xsl:choose> <xsl:when test="self::p[@class='p1'] or self::div"> <p><xsl:apply-templates select="current-group()"/></p> </xsl:when> <xsl:otherwise> <xsl:copy-of select="current-group()"/> </xsl:otherwise> </xsl:choose> </xsl:for-each-group> </xsl:copy> </xsl:template> <xsl:template match="p[@class='p1']"> <xsl:apply-templates/> </xsl:template> <xsl:template match="div[@class='disp-quote-p']"> <xsl:element name="disp-quote"> <xsl:apply-templates/> </xsl:element> </xsl:template>


Velocity 在 Spring Boot 中找不到模板资源

我使用 Velocity 模板引擎在我的 Spring boot 应用程序中使用电子邮件模板发送电子邮件实用程序。 当前的代码如下所示。 pom.xml: 我正在使用 Velocity 模板引擎在我的 Spring boot 应用程序中使用电子邮件模板发送电子邮件实用程序。 当前代码如下所示。 pom.xml: <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.7</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-tools</artifactId> <version>2.0</version> </dependency> 速度引擎 bean 配置: @Configuration public class VelocityConfig { @Bean public VelocityEngine velocityEngine() { VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); ve.init(); return ve; } } 电子邮件模板放置在 src/main/resources/email-templates/summary-email.vm <!DOCTYPE html> <head> <title>Summary</title> </head> <body> <h1>Claims Summary</h1> </body> </html> 放置在以下目录中: src ├── main │ ├── java │ │ └── com │ │ └── packageNameioot │ │ └── SpringBootApplication.java │ ├── resources │ │ ├── email-templates │ │ │ └── summary-email.vm │ │ └── application.properties 使用模板发送电子邮件的服务类: @Slf4j @Service @RequiredArgsConstructor public class EmailSummaryService { private final EmailConnector connector; private final VelocityEngine velocityEngine; public Mono<Void> sendFinanceClaimsRunEmailSummary(FinancePeriodRunEntity periodRunEntity, int successCount, int errorCount) { EmailDto emailDto = EmailDto.builder() .recipients(Set.of("[email protected]")) .subject("Claims summary") .body(createEmailBody()) .html(true) .build(); return connector.submitEmailRequest(emailDto); } private String createEmailBody() { VelocityContext context = new VelocityContext(); Template template = velocityEngine.getTemplate("email-templates/summary-email.vm"); StringWriter writer = new StringWriter(); template.merge(context, writer); return writer.toString(); } } 但是Velocity无法定位模板,出现以下错误。 ERROR velocity:96 - ResourceManager : unable to find resource 'email-templates/summary-email.vm' in any resource loader. org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'email-templates/summary-email.vm' 属性应该这样设置: VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); ve.setProperty("resource.loader.classpath.class", ClasspathResourceLoader.class.getName()); 根据 Apache Velocity Engine 文档。


我遇到了这个错误“获取 VM 异常:在 Solidity 合约中执行套利期间因原因字符串“UniswapV2:K”错误而恢复”

我一直在与uniswap和SushiSwap进行交叉交易所闪贷套利,但我不断收到此错误 VM 异常:已恢复,原因字符串“UniswapV2:K” 套利期间


有没有办法让我的 WordPress 网站指向 diste/templates 目录中的 index.html 而不是正常的 WordPress 行为?

我正在使用 Vue.js 开发一个无头 WordPress 网站,并且我有一个名为 vue-wordpress 的自定义主题。该主题是使用 Vue CLI 搭建的。这是目录结构 - 距离 资产 模板


X11无需putty转发

我正在尝试使用x11从Redhat服务器转发到Windows 10 VM来显示firefox。客户要求在虚拟机上不要使用其他软件,所以我不能使用 except 或 putty....


如何在Azure Function中获取连接字符串?

我在 Azure 云中有一个 Azure Function 和一个 PostreSQL DB。 我想从我的 Azure 函数访问连接字符串,我们将其称为 IT-PostgreSQL。 这是我的Azure功能: 命名空间


Intellij 自定义 VM 选项

我的大多数运行配置中有一个自定义虚拟机选项:“${eclipselink-javaagent}”,我需要编辑它,但我找不到任何方法来做到这一点。我是不是错过了什么?


私有端点连接Azure SQL数据库

我已经有 Azure SQL Server 的专用端点。在 Azure 数据工厂中创建链接服务时,如何配置 Azure SQL 数据库的专用端点?


如何在Linux VM中处理多个版本的Java

我有一个场景,我正在为自托管代理构建代理,并且我需要在该代理中安装maven,sonarQube等工具,但是maven使用1.8版本的jdk,而Sonar使用1.22


Nginx 和 Traefik 的性能非常慢

我们有以下基础设施来部署 PHP 应用程序: 运行 Nginx 作为代理的 VM Docker Swarm 集群中有 3 个节点 Traefik 容器部署在这个集群中(所以我们有 3 个包含...


Azure DevOps 服务器到 Azure DevOps 服务迁移

我已将本地 Azure DevOps 2020 服务器迁移到 Azure DevOps 服务作为试运行。 迁移将我现有的 [email protected] 帐户映射到我的 [email protected] ...


MVC ASP.NET Core Identity,创建登录、注册操作。 AuthController

公共类AuthController:控制器 { SignInManager _signInManager { 获取; } UserManager _userManager { 获取; } 角色管理器 public class AuthController : Controller { SignInManager<AppUser> _signInManager { get; } UserManager<AppUser> _userManager { get; } RoleManager<IdentityRole> _roleManager { get; } public AuthController(SignInManager<AppUser> signInManager, UserManager<AppUser> userManager, RoleManager<IdentityRole> roleManager) { _signInManager = signInManager; _userManager = userManager; _roleManager = roleManager; } public IActionResult Login() { return View(); } [HttpPost] public async Task<IActionResult> Login(string? returnUrl,LoginVM vm) { AppUser user; if (!ModelState.IsValid) { return View(vm); } if (vm.UsernameOrEmail.Contains("@")) { user = await _userManager.FindByEmailAsync(vm.UsernameOrEmail); } else { user = await _userManager.FindByNameAsync(vm.UsernameOrEmail); } if (user == null) { ModelState.AddModelError("", "Username or password is wrong"); return View(vm); } var result = await _signInManager.PasswordSignInAsync(user, vm.Password, vm.IsRemember, true); if (!result.Succeeded) { if (result.IsLockedOut) { ModelState.AddModelError("", "Too many attempts wait until " + DateTime.Parse(user.LockoutEnd.ToString()).ToString("HH:mm")); } else { ModelState.AddModelError("", "Username or password is wrong"); } return View(vm); } if (returnUrl != null) { return LocalRedirect(returnUrl); } return RedirectToAction("Index","Home"); } public IActionResult Register() { return View(); } [HttpPost] public async Task<IActionResult> Register(RegisterVM vm) { if (!ModelState.IsValid) { return View(vm); } var user = new AppUser { Fullname = vm.Fullname, Email = vm.Email, UserName = vm.Username }; var result = await _userManager.CreateAsync(user, vm.Password); if (!result.Succeeded) { foreach (var error in result.Errors) { ModelState.AddModelError("", error.Description); } return View(vm); } var roleResult = await _userManager.AddToRoleAsync(user, Roles.Member.ToString()); if (!roleResult.Succeeded) { ModelState.AddModelError("", "Something went wrong. Please contact admin"); return View(vm); } return View(); } public async Task<IActionResult> Logout() { await _signInManager.SignOutAsync(); return RedirectToAction("Index", "Home"); } public async Task<bool> CreateRoles() { foreach (var item in Enum.GetValues(typeof(Roles))) { if (!await _roleManager.RoleExistsAsync(item.ToString())) { var result = await _roleManager.CreateAsync(new IdentityRole { Name = item.ToString() }); if (!result.Succeeded) { return false; } } } return true; } } } 所以,我在代码中搞乱了登录、注册和注销,现在这个 RoleManager 的事情让我摸不着头脑。我只是想为我的管理员用户提供一些额外的权力,但我有点不知道该怎么做。如果您能用简单的语言解释步骤或需要进行哪些更改来帮助我,那就太棒了。 我的目标是让管理员用户在我的系统中体验更好,您对此的建议非常有用。尝试了解 RoleManager 的事情以及如何为我的管理员用户提供更多能力。您直接的帮助可能会对我解决这个问题产生很大的影响! 定义管理员角色 创建管理员用户 更新注册流程: var roleResult =等待_userManager.AddToRoleAsync(用户,vm.IsAdmin? Roles.Admin.ToString() : Roles.Member.ToString()); 使用管理员角色: [授权(角色=“管理员”)] 公共 IActionResult AdminDashboard() { // 特定于管理的逻辑 } 5.提升管理能力: if (User.IsInRole("管理员")) { // 特定于管理的逻辑 } 中间件配置: services.AddIdentity() .AddRoles() .AddEntityFrameworkStores(); 7.创建角色方法: 公共无效配置(IApplicationBuilder 应用程序,IHostingEnvironment env) { // 其他中间件配置 // Create roles during application startup var authController = new AuthController(/* inject your dependencies here */); authController.CreateRoles().GetAwaiter().GetResult(); }


通过 jpype 抑制 Python 中使用的 Java VM 的日志记录

有一些通过 jpype 包与 JVM 交互的 Python 代码。 JVM 中的代码有一些过于冗长的日志记录,这些日志记录被转储到控制台,我想抑制它,


获取具有特定标签的 Windows VM 列表的 Powershell 脚本

使用 powershell,我需要获取租户内所有订阅的 Windows 虚拟机列表。我只需要带有标签 ApplicationName 且其值中包含 PROD 的虚拟机。 这是我当前的脚本...


3 月 31 日之后 Azure 应用服务备份是否可用?

关于微软针对 azure 应用程序服务的声明,摘自此处 https://learn.microsoft.com/en-us/azure/app-service/manage-disaster-recovery “从 2025 年 3 月 31 日开始,Azure ...


无法识别的虚拟机选项“AggressiveOpts”

我正在尝试使用 Java 8 在 intelliJ 中运行我的加特林项目。 我知道 VM 选项“AggressiveOpts”在 Java 11 中已被弃用,并在 Java 12 中被删除,但我想知道为什么我会得到这个......


无法从模块 jdk.compiler 导出/打开包以在 Maven 中运行/通过测试

设置 我正在使用 JDK 22: openjdk版本“22”2024-03-19 OpenJDK 运行时环境(内部版本 22+36-2370) OpenJDK 64位服务器VM(构建22+36-2370,混合模式,共享) 我也在用


使用 Azure Devops REST API 创建交付计划样式规则

我正在尝试使用 Azure Devops REST API 在 Azure Devops 项目中创建交付计划。我使用以下方法来创建相同的。 https://learn.microsoft.com/en-us/rest/api/azure/devop...


自托管的 GitHub Actions Runner 可以在托管 GitHub Runner 的同一台计算机上部署应用程序吗?

我目前正在尝试使用在 Ubuntu VM 上运行的自托管 GitHub Actions Runner 来配置启用了 GitHub Actions 的 GitHub 存储库。 我想将我的应用程序部署到...


从消费计划Azure功能访问Azure KV

我在 VNET 中部署了一个 Azure Key Vault,并且禁用了公共访问。我需要从无服务器的消费 Azure 函数中获取该 KV 的秘密。 问题是,作为那种类型...


我对 azure devops 管道有疑问

现在,我今天有一个关于 Azure DevOps 管道的问题。您需要告诉我在下面的实例中触发 Azure DevOps 管道的原因,即使源...


尝试创建 Vertex AI 托管笔记本失败并出现错误:无法插入 GCE VM

我正在尝试在 GCP 中创建许多顶点 AI 托管笔记本(注意,不是用户管理的笔记本,而是托管笔记本)。每个都失败并出现相同的错误: 2023-07-10T02:36:05.3813609Z e[31m...


Powershell:Github Actions 与 Gitub Codespace 的不同行为(找不到类型:验证包含此类型的程序集是否已加载)

我需要在 Github Actions 工作流程中构建和使用这个 NET8 crypto.dll 类库。但看在上帝的份上,我无法让它与 Powershell(核心)一起工作。 运行程序在 Ubuntu VM 上运行...


Azure 存储模拟器问题

我在我的计算机上安装了 Azure 模拟器。然后尝试运行启动批处理,但失败并出现以下错误 C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>


Azure API 管理:如何将原始响应正文存储为变量并输出选定字段?

我在 Azure API 管理中创建了一个简单的 API,目的是在 Azure DevOps Boards 中创建工作项。我在 Azure Board 端点的 API 策略中创建了一个 标签...


azure function 应用程序环境的配置值

您正在开发一个Azure Function App。您使用 Azure Function App 主机不支持的语言开发代码。代码语言支持 HTTP 原语。 您必须部署...


列出 Azure 帐户中所有订阅的 Azure 资源

我需要列出所有订阅的 Azure 帐户中的 Azure SQL 服务器。 我需要在一次调用中列出所有订阅的它们,或者是否有其他方法可以实现此目的,例如使用脚本...


如何从 AzureRM 类型(自动)创建服务连接 Azure DevOps(使用服务主体-自动)

我需要创建从 Azure DevOps 中的许多项目到我在 Azure 中的订阅的连接。 我还需要他来自 azure 资源管理器类型,并且将创建他们的服务主体


有没有办法在Azure API管理后面运行Azure Web App?

无法正确运行使用 API 管理和 .这个想法是在 Azure APIM 背后拥有多个 Web 应用程序 我部署了一个示例 Python (...


配置 Azure 应用程序网关以从 Azure 存储容器提供静态网站服务

我需要一些帮助来解决 Azure 应用程序网关的问题。 我的想法是从 Azure 存储容器提供 SPA,因此我配置了启用静态网站的存储帐户。后背...


无法通过PAT令牌调用Azure DevOps Rest Api

我正在尝试使用 Azure DevOps Rest api 将保存在本地目录(桌面)中的 json 文件导入到 Azure DevOps 库变量组。 这是剧本。 $jsonbody = Get-Content -Path "C: ar...


Azure 中国的 Python 资源管理器客户端指向错误的端点

我正在尝试使用ARM模板将资源部署到Azure China。我有针对 Azure 执行此操作的代码,现在我正在针对 Azure 中国进行调整,我相信我应该执行的唯一更改...


按标签列出来自 Azure 的资源

我有以下简单的代码片段,用于按 Azure 标签列出资源,但我无法使过滤器工作。我究竟做错了什么? 使用 Azure.Core; 使用 Azure.Identity; 使用 Azure。


为 Azure SQL 托管实例设置 Active Directory 管理员失败

我无法在 Azure 门户中或使用 Cloud Shell 将 Active Directory 管理员添加到新创建的 SQL 托管实例。 当我在 Azure 门户中尝试时,操作失败...


passport-azure-ad / msal.js 和动态作用域

Azure AD v2.0 讨论了动态同意的优点之一 (https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/api-scopes#request-dynamic-scopes- for-增量-c...


无法在Azure databricks中实例化EventHubsSourceProvider

我尝试使用以下代码从 Azure Databricks 的事件中心读取数据。 从 pyspark.sql.functions 导入 * 从 pyspark.sql.types 导入 * NAMESPACE_NAME =“*myEventHub*&...


在 .NET Core 3.1 中验证 Azure AD 生成的 JWT 签名和算法

我是 Azure AD 新手。我们正在使用 v1.0 令牌。我有一个 Azure JWT 令牌验证例程,主要基于 ValidateSignature 和 AzureTokenValidation 以下是我的 ClaimsTransformer: 公共任务...


使用 Azure DEVOPS CLI 将特定用户分配给多个项目

我是 Azure DEVOPS CLI 的新手,我需要使用 AZURE DEVOPS CLI 为组织中的所有项目分配特定用户。该组织的项目总数约为 25 个。 格雷...


如何使用Azure Portal将容器应用程序连接到自定义VNet?

我正在尝试按照此处的说明进行操作: https://learn.microsoft.com/en-us/azure/container-apps/vnet-custom?tabs=bash%2Cazure-cli&pivots=azure-portal 上面的分步页面说明了


如何使用 Powershell 表达 Azure 文件共享位置

我正在尝试修改当前的Powershell以指向Azure文件共享。 目前,底部 Powershell 在本地驱动器中使用,但我想更改为指向 Azure 文件共享。 参数([圣...


如何连接到 Azure 虚拟网络中的数据库

我的本地计算机上运行着一个 Spring 应用程序服务器,我想与托管在 Azure 虚拟网络上的 MySQL 数据库建立连接。 Azure 指定只有资源...


© www.soinside.com 2019 - 2024. All rights reserved.